# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-net-ssh-perl
_pkgname=Net-SSH-Perl
pkgver=2.14
pkgrel=13
pkgdesc='Perl client interface to SSH.'
arch=('x86_64' 'aarch64')
license=('GPL' 'custom')
options=('!emptydirs')
depends=('perl-convert-pem' 'perl-crypt-dh' 'perl-crypt-dsa' 'perl-crypt-idea'
         'perl-crypt-rsa' 'perl-digest-bubblebabble' 'perl-digest-hmac'
         'perl-digest-sha1' 'perl-math-gmp' 'perl-string-crc32' 'perl-cryptx'
         'perl-scalar-list-utils')
url='http://search.cpan.org/dist/Net-SSH-Perl'
source=("http://search.cpan.org/CPAN/authors/id/S/SC/SCHWIGON/$_pkgname-$pkgver.tar.gz")
sha512sums=('49fee3e7969260a97453adfdac7ed3852130a7404ca5016f6d16549e478b8f2808f47c5801f2dbf991cfb33b5f2653d55360ba938d9b36016620a46e1ffea879')

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd "$_pkgname-$pkgver"

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd "$_pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

